<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="utf-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
		<title>heatmap.js Realtime heatmap based on mouse clicks</title>
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<style>
			body, html {
				margin:0;
				padding:0;
				font-family:Arial;
			}
			h1 {
				margin-bottom:10px;
			}
			#main {
				position:relative;
				width:940px;
				padding:20px;
				margin:auto;
			}
			#heatmapArea {
				position:relative;
				float:left;
				width:600px;
				height:400px;
				background-image:url(http://www.patrick-wied.at/static/heatmapjs/demo/realtime_heatmap/graphic.png);
				border:1px dashed black;
			}
			#configArea {
				position:relative;
				float:left;
				width:260px;
				padding:20px;
			}
			#gen {
				margin-top:25px;
				padding:10px 20px 10px 20px;
				-moz-border-radius:15px;
				-o-border-radius:15px;
				-webkit-border-radius:15px;
				border-radius:15px;
				border:2px solid black;
				cursor:pointer;
				color:white;
				background-color:black;
			}
			#gen:hover{
				background-color:grey;
				color:black;
			}
		</style>
		<link rel="shortcut icon" type="image/png" href="http://www.patrick-wied.at/img/favicon.png" />
	</head>
	<body>
		<div id="main">
			<h1>Realtime heatmap based on mouse clicks</h1>
			<a href="http://www.patrick-wied.at/static/heatmapjs/" title="heatmap.js">Back to the project page</a><br /><br />
			<div id="heatmapArea">
			
			</div>
			<div id="configArea">
				<h2>Sidenotes</h2>
				This is a demonstration of a realtime heatmap based on the user's mouse clicks<br /><br />
				<strong>Note: Just click on the element to the left ;)</strong>
				<div id="gen">Generate some random data</div>
			</div>
		</div>
		<script type="text/javascript" src="../../src/heatmap.js"></script>
		<script type="text/javascript">
	
	
		window.onload = function(){
			var xx = h337.create({"element":document.getElementById("heatmapArea"), "radius":25, "visible":true});
			
			xx.get("canvas").onclick = function(ev){
				var pos = h337.util.mousePosition(ev);
				xx.store.addDataPoint(pos[0],pos[1]);
			};
			
			document.getElementById("gen").onclick = function(){
				xx.store.generateRandomDataSet(100);
			};
		};
		
		</script>
	</body>
</html>
